package org.gy.T2;

public class LambdaTest1 {
    public static void main(String[] args) {
// ⽬标：认识Lambda表达式.
//1.创建⼀个Swimming接⼝的匿名内部类对象
        Swimming s = new Swimming(){
            @Override
            public void swim() {
                System.out.println("学⽣快乐的游泳~~~~");
            }
        };
        s.swim();

//2.使⽤Lambda表达式对Swimming接⼝的匿名内部类进⾏简化
        Swimming s1 = () -> {
            System.out.println("学⽣快乐的游泳~~~~");
        };
        s1.swim();
    }
}
